﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="StudentInExam.aspx.cs" Inherits="ExamAnalysis.Manage.StudentInExam" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
        .x-grid-cell-fullName .x-grid-cell-inner {
            font-family : tahoma, verdana;
            display     : block;
            font-weight : normal;
            font-style  : normal;
            color       : #385F95;
            white-space : normal;
        }
        
        .x-grid-rowbody div {
            margin : 2px 5px 20px 5px !important;
            width  : 99%;
            color  : Gray;
        }
        
        .x-grid-row-expanded td.x-grid-cell{
            border-bottom-width:0px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">

    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="ExamAnalysis.Model.ExamAnalysisDataContext" EntityTypeName="" 
        TableName="StudentInExam">
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="LinqDataSource3" runat="server" 
        ContextTypeName="ExamAnalysis.Model.ExamAnalysisDataContext" EntityTypeName="" 
        TableName="StudentInfo">
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
        ContextTypeName="ExamAnalysis.Model.ExamAnalysisDataContext" EntityTypeName="" 
        TableName="ExamInfo">
    </asp:LinqDataSource>
    <ext:GridPanel 
            runat="server" 
            ID="ClassInfoGridPanel" 
            Height="420" 
            Width="600"
            Title="考试成绩信息" 
            Frame="true">
            <Store>
                <ext:Store ID="Store2" runat="server"  >
                    <Model>
                        <ext:Model ID="Model1" runat="server" Name="StudentInExamInfo" IDProperty="StudentID">
                            <Fields>
                                <ext:ModelField Name="StudentID"  />
                                <ext:ModelField Name="Score" />
                                <ext:ModelField Name="ExamID" />
                                <ext:ModelField Name="StudentName" />
                                <ext:ModelField Name="StudentCode" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel ID="ColumnModel2" runat="server" > 
                <Columns>                
                    <ext:Column ID="Column2" runat="server" DataIndex="StudentCode" Text="学号"  Width="200">
                    </ext:Column>
                    <ext:Column ID="Column1" runat="server" DataIndex="StudentName" Text="学生姓名"  Width="200">
                       </ext:Column>            
                    <ext:Column ID="Column3" runat="server" DataIndex="Score" Text="成绩"  Width="200">
                    </ext:Column>
			    </Columns>
            </ColumnModel>    
            <SelectionModel>
              <ext:RowSelectionModel ID="RowSelectionModel3" runat="server" Mode="Single" />
             </SelectionModel>     
             <TopBar>
            <ext:Toolbar ID="Toolbar1" runat="server">
                    <Items>
                    <ext:DropDownField ID="DropDownField1" runat="server" Width="400" FieldLabel="相关考试" Text="请选择" >
                            <Component>
                                <ext:GridPanel ID="GridPanel1" Height="200" runat="server">

                                    <ColumnModel>
                                        <Columns>
                                            <ext:Column ID="Column12" runat="server" Width="250" Text="考试名称" DataIndex="ExamName" />
                                        </Columns>
                                    </ColumnModel>
                                    <SelectionModel>
                                         <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Single" />
                                    </SelectionModel>
                                        <Store>
                    <ext:Store ID="Store1" runat="server" DataSourceID="LinqDataSource2">
                        <Model>
                            <ext:Model ID="Model4" runat="server" IDProperty="ExamID">
                                <Fields>
                                    <ext:ModelField Name="ExamID" />
                                    <ext:ModelField Name="ExamName" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <BottomBar>
                <ext:Toolbar ID="Toolbar5" runat="server">
                <Items>
                 <ext:Button ID="Button1" Text="选择" runat="server" OnDirectClick="Button_Click" />
                 </Items>
                </ext:Toolbar>
                </BottomBar>
                                </ext:GridPanel>
                            </Component>
                        </ext:DropDownField>
                </Items>
                </ext:Toolbar>
            </TopBar>
            <BottomBar>
                <ext:Toolbar ID="Toolbar6" runat="server">
                <Items>
                 <ext:Button ID="Button2" Text="添加学生成绩" runat="server" OnDirectClick="Button2_Click" />
                 <ext:Button ID="Button3" Text="更改选中学生成绩" runat="server" OnDirectClick="Button3_Click" />
                 <ext:Button ID="Button4" Text="删除选中学生成绩" runat="server" OnDirectClick="Button4_Click" />
                 </Items>
                </ext:Toolbar>
                </BottomBar>
        </ext:GridPanel>
        <ext:Window 
            ID="FormWindow" 
            runat="server" 
            Title="成绩信息编辑" 
            Width="420" 
            Height="300"           
            BodyPadding="10" 
            Resizable="false" 
            Closable="True"
            Layout="Fit" AutoShow="False" HideCollapseTool="False" Hidden="True" HideMode="Visibility">
            <Items>
                <ext:FormPanel 
                    ID="FormPanel1" 
                    runat="server" 
                    Border="false" 
                    BodyStyle="background-color:transparent;"
                    DefaultAnchor="-10"
                    Layout="Form">
                    <Items> 
                            <ext:DropDownField ID="DropDownField3" runat="server" Width="400" FieldLabel="学生" Text="请选择">
                            <Component>
                                <ext:GridPanel ID="GridPanel3" Height="200" runat="server">

                                    <ColumnModel>
                                        <Columns>
                                            <ext:Column ID="Column6" runat="server" Width="150" Text="学号" DataIndex="StudentCode" />
                                            <ext:Column ID="Column7" runat="server" Width="150" Text="姓名" DataIndex="StudentName" />
                                        </Columns>
                                    </ColumnModel>
                                    <SelectionModel>
                                         <ext:RowSelectionModel ID="RowSelectionModel4" runat="server" Mode="Single" />
                                    </SelectionModel>
                                        <Store>
                    <ext:Store ID="Store4" runat="server" DataSourceID="LinqDataSource3" >
                        <Model>
                            <ext:Model ID="Model3" runat="server" IDProperty="StudentID">
                                <Fields>
                                    <ext:ModelField Name="StudentID" />
                                    <ext:ModelField Name="StudentName" />
                                    <ext:ModelField Name="StudentCode" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <BottomBar>
                <ext:Toolbar ID="Toolbar7" runat="server">
                <Items>
                 <ext:Button ID="Button6" Text="选择" runat="server" OnDirectClick="Button5_Click" />
                 </Items>
                </ext:Toolbar>
                </BottomBar>
                                </ext:GridPanel>
                            </Component>
                        </ext:DropDownField>      
                        <ext:NumberField
                            ID="Score" 
                            runat="server" 
                            Name="Score" 
                            MsgTarget="Side" 
                            AllowBlank="false"
                            FieldLabel="成绩" 
                            />            
                    </Items>
                </ext:FormPanel>
            </Items>
            <BottomBar>
        <ext:Toolbar ID="Toolbar2" runat="server">
                    <Items>
                        <ext:Button ID="Button7" runat="server" Icon="Add" Text="添加" Visible="true">
                          <DirectEvents>
                                <Click OnEvent="Add_Click" />
                           </DirectEvents>
                        </ext:Button>      
                         <ext:Button ID="Button8" runat="server" Icon="Accept" Text="更新" Visible="true">
                          <DirectEvents>
                                <Click OnEvent="Change_Click" />
                           </DirectEvents>
                        </ext:Button>              
                        <ext:ToolbarFill ID="ToolbarFill1" runat="server" /> 
                    </Items>
                </ext:Toolbar>
            </BottomBar>
        </ext:Window>
</asp:Content>
